package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
/* 套餐菜品映射
* */
public interface SetmealDishMapper {
    //查询id引用次数
    Integer getCountByDishIds(List<Long> ids);

    //根据菜品id查询套餐id
    List<Long> getSetmealIdsByDishIds(List<Long> dishIds);

    //保存关联关系
    void insertBatch(List<SetmealDish> setmealDishes);

    //根据id删除套餐中和菜品的关联数据
    @Delete("delete from setmeal_dish where setmeal_id = #{setmealId}")
    void deleteBySetmealId(Long setmealId);
}
